@if(count($topics))
    <div>
        <ul class="list-unstyled">
            @foreach($topics as $topic)
                <li class="media mt-2 mb-2">
                    <img class="mr-3" style="width: 40px;" src="{{asset('images/avatar.jpeg')}}"/>
                    <div class="media-body">
                        <p>{{$topic->title}}</p>
                        <span>{{$topic->user->name}}</span>
                        <span class="ml-2 badge badge-primary">{{$topic->category->name}}</span>
                        <span class="ml-2">{{$topic->updated_at->diffForHumans()}}</span>
                        <span class="ml-2 badge badge-secondary badge-pill float-right">{{$topic->reply_count}}</span>
                    </div>
                </li>
                <hr/>
            @endforeach
        </ul>
        {{$topics}}
    </div>
    @else
    <div>暂无数据</div>
@endif
